package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     *  根据菜品id判断菜品是否被关联
     * @param dishIds
     * @return
     */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

    /**
     * 在套餐，菜品表插入
     * @param setmealDishes
     */
    //@AutoFill(value = OperationType.INSERT)
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 根据id查询菜品套餐表
     * @param id
     * @return
     */
    List<SetmealDish> getSetmealDishById(Long id);

    /**
     * 根据 setmeal_id 删除
     * @param ids
     */
    void delete(@Param("ids")List<Long> ids);
}
